#include <iostream>
#include <vector>
#include <map>
using namespace std;

// use map
{
	typedef map<int, int> MII;
	MII mp;
	int p = n;
	for (int i = 2; i * i <= n; ++i)
	{
		while (p % i == 0)
		{
			++mp[i];
			p /= i;
		}
	}
	if (p != 1)
		++mp[p];
}


// use vecotr (more efficient)
{
	typedef vector<pair<int, int> > VPII;
	VPII mp;
	int p = n;
	for (int i = 2; i * i <= n; ++i)
	{
		if (p % i == 0)
		{
			mp.push_back(make_pair(i, 1));
			p /= i;
		}
		while (p % i == 0)
		{
			mp.back().second += 1;
			p /= i;
		}
	}
	if (p != 1)
		mp.push_back(make_pair(p, 1));
}